<template>
  <div class="panel">
    <h3>关系类型分布</h3>
    <el-table :data="relations" style="width: 100%">
      <el-table-column prop="relation" label="关系类型" width="180" />
      <el-table-column prop="count" label="数量" />
    </el-table>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

const relations = ref([])

onMounted(async () => {
  const res = await fetch('http://127.0.0.1:8000/relation-distribution') // 注意后端地址
  relations.value = await res.json()
})
</script>